﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Jc.MicroDesigner.Drawings.Tools
{
    /// <summary>
    /// Форма для выбора параметров текста
    /// </summary>
    public partial class TextToolForm : Form
    {
        /// <summary>
        /// Создать форму
        /// </summary>
        public TextToolForm()
        {
            InitializeComponent();
            fontOptionsDialog.Font = this.Font;
            PreviewText.Font = fontOptionsDialog.Font;
        }

        private void FontSelectBtn_Click(object sender, EventArgs e)
        {
            if (fontOptionsDialog.ShowDialog() == DialogResult.OK)
            {
                PreviewText.Font = fontOptionsDialog.Font;
            }
        }

        private void ValueBox_TextChanged(object sender, EventArgs e)
        {
            PreviewText.Text = ValueBox.Text;
        }

        /// <summary>
        /// Текст
        /// </summary>
        public string TextValue
        {
            get
            {
                return ValueBox.Text;
            }
        }

        /// <summary>
        /// Шрифт для текста
        /// </summary>
        public Font TextFont
        {
            get
            {
                return PreviewText.Font;
            }
        }
    }
}